<!DOCTYPE html
  PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- saved from url=(0014)about:internet -->
<html xmlns:MSHelp="http://www.microsoft.com/MSHelp/" lang="en-us" xml:lang="en-us"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<meta name="DC.Type" content="reference">
<meta name="DC.Title" content="task_scheduler_observer">
<meta name="DC.subject" content="task_scheduler_observer">
<meta name="keywords" content="task_scheduler_observer">
<meta name="DC.Relation" scheme="URI" content="../../reference/task_scheduler.htm">
<meta name="DC.Relation" scheme="URI" content="../../reference/task_scheduler/task_scheduler_observer/task_scheduler_observer_member.htm">
<meta name="DC.Format" content="XHTML">
<meta name="DC.Identifier" content="task_scheduler_observer_member">
<meta name="DC.Language" content="en-US">
<link rel="stylesheet" type="text/css" href="../../intel_css_styles.css">
<title>task_scheduler_observer</title>
</head>
<body id="task_scheduler_observer_member">
 <!-- ==============(Start:NavScript)================= -->
 <script src="..\..\NavScript.js" language="JavaScript1.2" type="text/javascript"></script>
 <script language="JavaScript1.2" type="text/javascript">WriteNavLink(2);</script>
 <!-- ==============(End:NavScript)================= -->
<a name="task_scheduler_observer_member"><!-- --></a>


    <h1 class="topictitle1">task_scheduler_observer</h1>

    
    <div>
        <div class="section"><h2 class="sectiontitle">Summary</h2><p>Class that represents thread's interest in task scheduling services.</p>
</div>
<div class="section"><h2 class="sectiontitle">Syntax</h2>
            <pre>class task_scheduler_observer;</pre></div>
<div class="section"><h2 class="sectiontitle">Header</h2><p>
                <pre>#include "tbb/task_scheduler_observer.h"</pre>
            </p>
</div>
<div class="section"><h2 class="sectiontitle">Description</h2><p>A <samp class="codeph">task_scheduler_observer</samp> permits clients to observe when a thread starts or
                stops participating in task scheduling (globally). You typically derive your own observer class
                from task_scheduler_observer, and override virtual methods
                    <samp class="codeph">on_scheduler_entry</samp> or <samp class="codeph">on_scheduler_exit</samp>. An
                instance has a state <em>observing or not observing</em>. Remember to call
                    <samp class="codeph">observe()</samp> to enable observation.</p>
</div>
<div class="section"><h2 class="sectiontitle">Members</h2>
            <pre>namespace tbb {
&nbsp;&nbsp;&nbsp; class task_scheduler_observer {
&nbsp;&nbsp;&nbsp; public:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; task_scheduler_observer();
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; virtual ~task_scheduler_observer();
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; void observe( bool state=true );
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bool is_observing() const;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; virtual void on_scheduler_entry( bool is_worker ) {}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; virtual void on_scheduler_exit( bool is_worker } {}
&nbsp;&nbsp;&nbsp; };
&nbsp; }</pre></div>

 </div>
 
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong>&nbsp;<a href="../../reference/task_scheduler.htm">Task Scheduler</a></div>
</div>
<div>
<ul class="ullinks">
<li class="ulchildlink"><a href="../../reference/task_scheduler/task_scheduler_observer/task_scheduler_observer_member.htm">task_scheduler_observer Members</a><br>
</li>
</ul>
</div>

</body>
</html>
